#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'

void dfs(string s1, string s2) {
	char root = s2[s2.size() - 1];
	cout << root;
	int l = s1.find(root), r = s1.size() - l - 1;
	if (l) {
		string s1_l = s1.substr(0, l);
		string s2_l = s2.substr(0, l);
		dfs(s1_l, s2_l);
	}
	if (r) {
		string s1_r = s1.substr(l + 1, r);
		string s2_r = s2.substr(l, r);
		dfs(s1_r, s2_r);
	}
}

int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	string s1, s2; cin >> s1 >> s2;
	dfs(s1, s2);
	return 0;
}